const express = require('express');
const db = require('../uilit/mysql');

const router=express.Router();

// 获取前端传递企业信息数据，将数据保存在公司表中
router.post('/addcompany',(req,res)=>{
    let sqladdcompany=`update company set c_name='${req.body.name}',ind_id=,c_nature='${req.body.nature}',c_size='${req.body.size}',
    pro_id=,city_id=,area_id=,c_address='${req.body.address}',c_bname='${req.body.boss}',c_hrname='${req.body.person}',
    c_hrtel='${req.body.tel}',c_hremail='${req.body.email}',c_intr='${req.body.introduction}' where c_id=${parseInt(req.body.id)};`;
    db.query(sqladdcompany,(err)=>{
        if(err){
            console.log(err);
        }else{
            res.send({code:res.statusCode});
        }
    });
});